# from openpyxl import Workbook
#
# wb = Workbook()
# ws = wb.active
#
# # 设置第二行行高
# ws.row_dimensions[2].height = 30
# # 设置第C列列宽
# ws.column_dimensions['C'].width = 50
#
# # 保存
# wb.save('设置行高列宽与合并单元格.xlsx')


# 合并单元格
# from openpyxl import load_workbook
#
# wb = load_workbook('设置行高列宽与合并单元格.xlsx')
# sheet = wb.create_sheet('Sheet2')
# # 合并单元格
# sheet.merge_cells('A1:D3')
# # 保存
# wb.save('设置行高列宽与合并单元格.xlsx')


# 拆分单元格
from openpyxl import load_workbook

wb = load_workbook('设置行高列宽与合并单元格.xlsx')
sheet = wb['Sheet2']
# 拆分单元格
sheet.unmerge_cells('A1:D3')
# 保存
wb.save('设置行高列宽与合并单元格.xlsx')